<?php
include "./base.php";
$sql="select * from userinfo order by uid desc ;";
$res = mysql_query($sql);
$arr = array();
//利用循环解析数据
while($row = mysql_fetch_assoc($res)){
    //往数组当中添加数据
    array_push($arr,$row);//将$row里面的数据push到$arr;
}
//输出抓换成JSON的数据
print_r(json_encode($arr));
?>